

import 'package:flustars/flustars.dart';
import 'package:json_annotation/json_annotation.dart';
import 'package:yuan_hang_app/views/home/model/leads.dart';

part 'leads_history.g.dart';

@JsonSerializable()
class LeadsHistory {
  ///id
  int? id;
  ///线索ID
  int? clueId;
  ///操作时间
  @JsonKey(fromJson: fullDateFromJson)
  String? contactTime;
  ///意向级别
  int? contactLevel;
  ///线索状态
  int? operatorAfterStatus;
  ///操作人
  String? contactPersonName;
  ///操作类型
  String? contactType;
  ///操作备注
  String? description;
  ///跟进方式
  String? followMethod;
  ///跟进ID
  int? clueFollowId;
  ///试驾ID
  String? testDriverId;
  ///预约ID
  String? appointmentId;

  LeadsHistory({this.id, this.clueId, this.contactTime, this.contactLevel, this.operatorAfterStatus, this.contactPersonName, this.contactType,this.description,this.followMethod,this.clueFollowId,this.testDriverId,this.appointmentId});

  factory LeadsHistory.fromJson(Map<String, dynamic> json) => _$LeadsHistoryFromJson(json);

  Map<String,dynamic> toJson() => _$LeadsHistoryToJson(this);
}

String? fullDateFromJson(String? dateTime) {
  return (dateTime == null || dateTime == "") ? ""  : DateUtil.formatDate(DateTime.parse(dateTime), format: DateFormats.full);
}
